package IU;

import Entidades.Localidad;
import Entidades.Operario;
import Entidades.Pais;
import Entidades.Provincia;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import utiles.Validador;
import Controladores.CtrlAMBOperario;
import Controladores.CtrlEstadoOperario;
import Controladores.CtrlLocalidad;
import Controladores.CtrlPais;
import Controladores.CtrlProvincia;
import Controladores.CtrlRol;
import Controladores.CtrlTipodocumento;
import Controladores.CtrlOperariorol;
import Controladores.CtrlArea;
import Controladores.CtrlCargo;

import Entidades.Estadooperario;
import Entidades.Rol;
import Entidades.Tipodocumento;
import Entidades.Operariorol;
import Entidades.Area;
import Entidades.Cargo;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author  
 * 
 * 
 */
public class ABMOperario extends javax.swing.JFrame {

    private String apellido, nombre, tipodoc, cuil, estadopersona, direccion, codigopostal, fechaAlta, fechaBaja;
    private String pais;
    private String provincia;
    private String localidad;
    String numerodoc;
    int telefono1;
    int telefono2;
    int tel3;
    int tel4;
    Operario operario;
    TablaPersonalizada tableModel;
    private List listarol, listaarea, listacargo;
    CtrlAMBOperario controladorop;
    CtrlPais controladorpais;
    CtrlProvincia controladorprov;
    CtrlLocalidad controladorlocal;
    CtrlTipodocumento controladortd;
    CtrlEstadoOperario controladorep;
    CtrlRol controladorrol;
    CtrlArea controladorarea;
    CtrlCargo controladorcargo;
    CtrlOperariorol controperariorol;
    Operario o;
    Operariorol operol;
    Validador validador;
    private List listaep, listatd, listaprov, listapais, listaloc, listao, listac;
    //acá ver si puedo hacer lo mismo con pais provincia traer la collection de provincia
    Collection<Localidad> localidadesCollection = new ArrayList<Localidad>();
    Estadooperario miestado = null;
    String rol;
    Rol rolper;
    Area areaper;
    Cargo cargoper;
    private Object c;
    private List listaop;
    private List list;
    private List<Operario> listaoactivo,listaobaja;
    private List<Operariorol> listaOperol;

  

    public ABMOperario(String operario) {
        initComponents();
        controladorop = new CtrlAMBOperario();
        controladorpais = new CtrlPais();
        controladorprov = new CtrlProvincia();
        controladorlocal = new CtrlLocalidad();
        controladortd = new CtrlTipodocumento();
        controladorep = new CtrlEstadoOperario();
        controladorrol = new CtrlRol();
        controladorarea = new CtrlArea();
        controladorcargo = new CtrlCargo();
        controperariorol = new CtrlOperariorol();
        jPanel4.setVisible(false);
        String op = operario;
        jTextFieldUsuario3.setText(op);
        jPanel7.setVisible(false);
        //alta
        cargarTabla();
        cargarTabla1();
        cargarComboApellido();
      //   cargarTablaOperariosbaja();
        cargarTipoDocumento();
        cargarComboEstadoPersona();
        cargarComboPaises();
       cargarComboPaises1();

       jComboBoxpais.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				rellenaCombo2((String) jComboBoxpais.getSelectedItem());
			}



		});

rellenaCombo2((String) jComboBoxpais.getSelectedItem());

jComboBoxprovincia.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				rellenaCombo3((String) jComboBoxprovincia.getSelectedItem());
			}

           		});
rellenaCombo3((String) jComboBoxprovincia.getSelectedItem());

jComboBoxlocalidad.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				rellenaCombo4((String) jComboBoxlocalidad.getSelectedItem());
			}



           		});
rellenaCombo4((String) jComboBoxlocalidad.getSelectedItem());


jComboBoxpais1.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				rellenaCombo5((String) jComboBoxpais1.getSelectedItem());
			}



		});

rellenaCombo5((String) jComboBoxpais1.getSelectedItem());

jComboBoxprovincia1.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				rellenaCombo6((String) jComboBoxprovincia1.getSelectedItem());
			}

           		});
rellenaCombo6((String) jComboBoxprovincia1.getSelectedItem());

jComboBoxlocalidad1.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
				rellenaCombo7((String) jComboBoxlocalidad1.getSelectedItem());
			}



           		});
rellenaCombo7((String) jComboBoxlocalidad1.getSelectedItem());

     // cargarComboProvincias();
      // cargarComboLocalidades();
        //   cargarComboRol();
        //fin alta
        //consultar
        cargarComboApellido();
//         cargarComboApellidoRol();
        //fin consultar
        //modificar
        cargarTabla();//ojo que está cargando el primero
        cargarTipoDocumento1();
        cargarComboEstadoPersona1();
     //   cargarComboPaises1();
  //    cargarComboProvincias1();
       // cargarComboLocalidades1();
      //  cargarComboCuil1();
        //cargarComboArea();
       //cargarComboCargo();
       //cargarComboRol();
//jButtonAsignarRolOperario.setEnabled(false);
jButtonAsignarRolOperario.setVisible(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        GestorPesajeJpaPU2EntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("GestorPesajeJpaPU2").createEntityManager();
        tipodocumentoQuery = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT t FROM Tipodocumento t");
        tipodocumentoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : tipodocumentoQuery.getResultList();
        localidadQuery = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT l FROM Localidad l");
        localidadList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : localidadQuery.getResultList();
        operarioQuery = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT o FROM Operario o");
        operarioList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : operarioQuery.getResultList();
        operariorolQuery = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT o FROM Operariorol o");
        operariorolList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : operariorolQuery.getResultList();
        operarioQuery1 = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT o FROM Operario o");
        operarioList1 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : operarioQuery1.getResultList();
        operarioQuery2 = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT o FROM Operario o");
        operarioList2 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : operarioQuery2.getResultList();
        operarioQuery3 = java.beans.Beans.isDesignTime() ? null : GestorPesajeJpaPU2EntityManager.createQuery("SELECT o FROM Operario o");
        operarioList3 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : operarioQuery3.getResultList();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jButtonGuardar = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jTextFieldapellido = new javax.swing.JTextField();
        jTextFieldnombre = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jComboBoxtipoDocumento = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jTextFieldnumeroDocumento = new javax.swing.JTextField();
        jComboBoxestadoPersona = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jTextFieldcuil = new javax.swing.JTextField();
        jTextFielddireccion = new javax.swing.JTextField();
        jComboBoxpais = new javax.swing.JComboBox();
        jComboBoxlocalidad = new javax.swing.JComboBox();
        jTextFieldtelefono1 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jTextFieldtelefono2 = new javax.swing.JTextField();
        jTextFieldcodigoPostal = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jComboBoxprovincia = new javax.swing.JComboBox();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTableOperarios = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jTextFieldapellido1 = new javax.swing.JTextField();
        jTextFieldnombre1 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jComboBoxtipoDocumento1 = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jTextFieldnumeroDocumento1 = new javax.swing.JTextField();
        jComboBoxestadoPersona1 = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTextFieldcuil1 = new javax.swing.JTextField();
        jTextFielddireccion1 = new javax.swing.JTextField();
        jComboBoxpais1 = new javax.swing.JComboBox();
        jComboBoxlocalidad1 = new javax.swing.JComboBox();
        jTextFieldtelefono3 = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jTextFieldtelefono4 = new javax.swing.JTextField();
        jTextFieldcodigoPostal1 = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jComboBoxprovincia1 = new javax.swing.JComboBox();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        eliminar = new javax.swing.JButton();
        modificar = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        ButtBuscar = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jComboBoxCuil = new javax.swing.JComboBox();
        jButtonBuscarCon = new javax.swing.JButton();
        jLabelApellidoCon = new javax.swing.JLabel();
        jTextFielcuil = new javax.swing.JTextField();
        jLabelDniCon = new javax.swing.JLabel();
        jTextFieldNombreListar = new javax.swing.JTextField();
        jLabelTelCon = new javax.swing.JLabel();
        jTextFielTelefono = new javax.swing.JTextField();
        jLabelDireccionCon = new javax.swing.JLabel();
        txtDireccionCon = new javax.swing.JTextField();
        jLabel38 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTableOB = new javax.swing.JTable();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        ButtBuscar1 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jLabel34 = new javax.swing.JLabel();
        jComboBoxRol = new javax.swing.JComboBox();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jComboBoxArea = new javax.swing.JComboBox();
        jComboBoxCargo = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jButtonAsignarRolOperario = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTableACR = new javax.swing.JTable();
        jScrollPane7 = new javax.swing.JScrollPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableOperario = new javax.swing.JTable();
        jButtonAsignarRolOperario1 = new javax.swing.JButton();
        jButtonSalir = new javax.swing.JButton();
        jPanel16 = new javax.swing.JPanel();
        jTextFieldUsuario3 = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Gestionar Operarios - Sistema Gestor de Pesaje para Bodegas");

        jTabbedPane1.setForeground(new java.awt.Color(102, 0, 102));
        jTabbedPane1.setFont(new java.awt.Font("Segoe UI", 3, 12));

        jButtonGuardar.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButtonGuardar.setForeground(new java.awt.Color(102, 0, 102));
        jButtonGuardar.setText("Guardar");
        jButtonGuardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGuardarActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel4.setText("Apellido:");

        jTextFieldapellido.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jTextFieldnombre.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel2.setText("Nombre:");

        jLabel10.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel10.setText("Tipo Documento:");

        jComboBoxtipoDocumento.setFont(new java.awt.Font("Segoe UI", 0, 11));
        jComboBoxtipoDocumento.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxtipoDocumento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxtipoDocumentoActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel12.setText("Número D.N.I :");

        jTextFieldnumeroDocumento.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jComboBoxestadoPersona.setFont(new java.awt.Font("Segoe UI", 0, 11));
        jComboBoxestadoPersona.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxestadoPersona.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxestadoPersonaActionPerformed(evt);
            }
        });

        jLabel14.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel14.setText("Estado Civil:");

        jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel1.setText("Cuil:");

        jTextFieldcuil.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jTextFielddireccion.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jComboBoxpais.setFont(new java.awt.Font("Segoe UI", 0, 11));
        jComboBoxpais.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jComboBoxlocalidad.setFont(new java.awt.Font("Segoe UI", 0, 11));
        jComboBoxlocalidad.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jTextFieldtelefono1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel15.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel15.setText("Telefono 2:");

        jTextFieldtelefono2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jTextFieldcodigoPostal.setEditable(false);
        jTextFieldcodigoPostal.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel16.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel16.setText("Código Postal:");

        jLabel17.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel17.setText("Provincia:");

        jComboBoxprovincia.setFont(new java.awt.Font("Segoe UI", 0, 11));
        jComboBoxprovincia.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel18.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel18.setText("Dirección:");

        jLabel19.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel19.setText("Pais: ");

        jLabel20.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel20.setText("Localidad:");

        jLabel21.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel21.setText("Telefono 1: ");

        jLabel8.setForeground(new java.awt.Color(255, 0, 51));
        jLabel8.setText("*");

        jLabel9.setForeground(new java.awt.Color(255, 0, 51));
        jLabel9.setText("*");

        jLabel30.setForeground(new java.awt.Color(255, 0, 51));
        jLabel30.setText("*");

        jLabel31.setForeground(new java.awt.Color(255, 0, 51));
        jLabel31.setText("*");

        jLabel32.setForeground(new java.awt.Color(255, 0, 51));
        jLabel32.setText("*");

        jLabel33.setForeground(new java.awt.Color(255, 0, 51));
        jLabel33.setText("*  Ingreso de Datos obligatorios");

        jLabel37.setForeground(new java.awt.Color(255, 0, 51));
        jLabel37.setText("*");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel19)
                                    .addGap(18, 18, 18)
                                    .addComponent(jComboBoxpais, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(30, 30, 30)
                                    .addComponent(jLabel17)
                                    .addGap(18, 18, 18)
                                    .addComponent(jComboBoxprovincia, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel20))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel21)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jTextFieldtelefono1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel15)))
                            .addGap(18, 18, 18)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jTextFieldtelefono2, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jComboBoxlocalidad, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel16)
                                    .addGap(18, 18, 18)
                                    .addComponent(jTextFieldcodigoPostal, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel18)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jTextFielddireccion))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel10)
                                            .addGap(18, 18, 18)
                                            .addComponent(jComboBoxtipoDocumento, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel4)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jTextFieldapellido, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel1)
                                            .addGap(38, 38, 38)
                                            .addComponent(jTextFieldcuil, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(12, 12, 12)
                                            .addComponent(jLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(77, 77, 77)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel2)
                                            .addGap(18, 18, 18)
                                            .addComponent(jTextFieldnombre, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel12)
                                                .addComponent(jLabel14))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jComboBoxestadoPersona, 0, 185, Short.MAX_VALUE)
                                                .addComponent(jTextFieldnumeroDocumento))))))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel33, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 435, Short.MAX_VALUE)
                        .addComponent(jButtonGuardar)))
                .addGap(418, 418, 418))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTextFieldapellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jTextFieldnombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9))
                .addGap(31, 31, 31)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxtipoDocumento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jLabel12)
                    .addComponent(jTextFieldnumeroDocumento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel30))
                .addGap(36, 36, 36)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextFieldcuil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(jComboBoxestadoPersona, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel37))
                .addGap(45, 45, 45)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jTextFielddireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31))
                .addGap(48, 48, 48)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jComboBoxlocalidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16)
                    .addComponent(jTextFieldcodigoPostal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBoxpais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBoxprovincia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel19))
                .addGap(46, 46, 46)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jTextFieldtelefono1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldtelefono2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15)
                    .addComponent(jLabel32))
                .addGap(71, 71, 71)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonGuardar)
                    .addComponent(jLabel33))
                .addContainerGap(161, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Alta Operario", jPanel1);

        jScrollPane2.setViewportBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jScrollPane2.setAutoscrolls(true);

        jTableOperarios.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jTableOperarios.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null}
            },
            new String [] {
                "Apellido", "Nombre", "Tipo Documento", "Nro Documento", "Telefono 1", "Pais", "Provincia", "Localidad"
            }
        ));
        jTableOperarios.setAutoscrolls(false);
        jTableOperarios.setFillsViewportHeight(true);
        jTableOperarios.setMinimumSize(new java.awt.Dimension(55, 55));
        jTableOperarios.setPreferredSize(new java.awt.Dimension(200, 42));
        jTableOperarios.setRowHeight(14);
        jTableOperarios.getTableHeader().setResizingAllowed(false);
        jTableOperarios.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableOperariosMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jTableOperarios);

        jScrollPane2.setViewportView(jScrollPane3);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Datos Personales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jLabel5.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel5.setText("Apellido:");

        jTextFieldapellido1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jTextFieldapellido1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldapellido1ActionPerformed(evt);
            }
        });

        jTextFieldnombre1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel3.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel3.setText("Nombre:");

        jLabel11.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel11.setText("Tipo Documento:");

        jComboBoxtipoDocumento1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel13.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel13.setText("Número D.N.I :");

        jTextFieldnumeroDocumento1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jComboBoxestadoPersona1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel22.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel22.setText("Estado Persona:");

        jLabel6.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel6.setText("Cuil:");

        jTextFieldcuil1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jTextFielddireccion1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jComboBoxpais1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jComboBoxlocalidad1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxlocalidad1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jComboBoxlocalidad1MousePressed(evt);
            }
        });

        jTextFieldtelefono3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel23.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel23.setText("Telefono 2:");

        jTextFieldtelefono4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jTextFieldtelefono4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldtelefono4ActionPerformed(evt);
            }
        });

        jTextFieldcodigoPostal1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel24.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel24.setText("Código Postal:");

        jLabel25.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel25.setText("Provincia:");

        jComboBoxprovincia1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel26.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel26.setText("Dirección:");

        jLabel27.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel27.setText("Pais: ");

        jLabel28.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel28.setText("Localidad:");

        jLabel29.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel29.setText("Telefono 1: ");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldtelefono3, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel23)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldtelefono4, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel27)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxpais1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel25)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBoxprovincia1, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(29, 29, 29)
                                .addComponent(jLabel28)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBoxlocalidad1, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(28, 28, 28)
                                .addComponent(jLabel24)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextFieldcodigoPostal1, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE))
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel5)
                                        .addGap(18, 18, 18)
                                        .addComponent(jTextFieldapellido1, javax.swing.GroupLayout.PREFERRED_SIZE, 308, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel26)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFielddireccion1, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel11)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jComboBoxtipoDocumento1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel13)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel6))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jTextFieldnumeroDocumento1)
                                    .addComponent(jTextFieldnombre1)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                                        .addComponent(jTextFieldcuil1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(39, 39, 39)
                                        .addComponent(jLabel22)
                                        .addGap(18, 18, 18)
                                        .addComponent(jComboBoxestadoPersona1, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(140, 140, 140)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTextFieldapellido1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jTextFieldnombre1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jComboBoxtipoDocumento1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldnumeroDocumento1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addGap(27, 27, 27)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(jTextFielddireccion1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldcuil1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(jComboBoxestadoPersona1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(jTextFieldtelefono3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23)
                    .addComponent(jTextFieldtelefono4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(jComboBoxpais1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25)
                    .addComponent(jComboBoxprovincia1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(jComboBoxlocalidad1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(jTextFieldcodigoPostal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23))
        );

        jButton2.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButton2.setForeground(new java.awt.Color(102, 0, 102));
        jButton2.setText("Modificar Datos");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        eliminar.setFont(new java.awt.Font("Segoe UI", 3, 12));
        eliminar.setForeground(new java.awt.Color(102, 0, 102));
        eliminar.setText("Eliminar");
        eliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                eliminarActionPerformed(evt);
            }
        });

        modificar.setFont(new java.awt.Font("Segoe UI", 3, 12));
        modificar.setForeground(new java.awt.Color(102, 0, 102));
        modificar.setText("Modificar");
        modificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modificarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap(792, Short.MAX_VALUE)
                        .addComponent(eliminar)
                        .addGap(31, 31, 31)
                        .addComponent(modificar))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jButton2)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 890, Short.MAX_VALUE))))
                .addContainerGap(23, Short.MAX_VALUE))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 981, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(23, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton2)
                .addGap(18, 18, 18)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 85, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(eliminar)
                    .addComponent(modificar))
                .addGap(56, 56, 56))
        );

        jTabbedPane1.addTab("Modificar/Eliminar", jPanel2);

        jScrollPane5.setAutoscrolls(true);

        ButtBuscar.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Datos del Operario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Operarios Activos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jLabel7.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel7.setText("Apellido:");

        jComboBoxCuil.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxCuil.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jComboBoxCuilMousePressed(evt);
            }
        });
        jComboBoxCuil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxCuilActionPerformed(evt);
            }
        });

        jButtonBuscarCon.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButtonBuscarCon.setForeground(new java.awt.Color(102, 0, 102));
        jButtonBuscarCon.setMnemonic('B');
        jButtonBuscarCon.setText("Buscar");
        jButtonBuscarCon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBuscarConActionPerformed(evt);
            }
        });

        jLabelApellidoCon.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabelApellidoCon.setText("Cuil:");

        jTextFielcuil.setEditable(false);
        jTextFielcuil.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabelDniCon.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabelDniCon.setText("Nombre:");

        jTextFieldNombreListar.setEditable(false);
        jTextFieldNombreListar.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabelTelCon.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabelTelCon.setText("D.N.I :");

        jTextFielTelefono.setEditable(false);
        jTextFielTelefono.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabelDireccionCon.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabelDireccionCon.setText("Dirección: ");

        txtDireccionCon.setEditable(false);
        txtDireccionCon.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel38.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel38.setText("Teléfono:");

        jTextField1.setEditable(false);
        jTextField1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTelCon)
                    .addComponent(jLabelDireccionCon)
                    .addComponent(jLabel7)
                    .addComponent(jLabelDniCon)
                    .addComponent(jLabelApellidoCon)
                    .addComponent(jLabel38))
                .addGap(33, 33, 33)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFielcuil, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                            .addComponent(txtDireccionCon, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                            .addComponent(jTextFielTelefono, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                            .addComponent(jComboBoxCuil, javax.swing.GroupLayout.Alignment.TRAILING, 0, 376, Short.MAX_VALUE)
                            .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(jButtonBuscarCon))
                    .addComponent(jTextFieldNombreListar, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jComboBoxCuil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonBuscarCon))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelDniCon)
                    .addComponent(jTextFielcuil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelApellidoCon)
                    .addComponent(jTextFieldNombreListar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTelCon)
                    .addComponent(jTextFielTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelDireccionCon)
                    .addComponent(txtDireccionCon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel38)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jButton3.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButton3.setForeground(new java.awt.Color(102, 0, 102));
        jButton3.setText("Consultar  Bajas");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Operarios dados de Baja", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jTableOB.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane8.setViewportView(jTableOB);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(62, 62, 62)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(58, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(47, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout ButtBuscarLayout = new javax.swing.GroupLayout(ButtBuscar);
        ButtBuscar.setLayout(ButtBuscarLayout);
        ButtBuscarLayout.setHorizontalGroup(
            ButtBuscarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ButtBuscarLayout.createSequentialGroup()
                .addContainerGap(55, Short.MAX_VALUE)
                .addGroup(ButtBuscarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(28, 28, 28)
                .addComponent(jButton3)
                .addGap(401, 401, 401))
        );
        ButtBuscarLayout.setVerticalGroup(
            ButtBuscarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ButtBuscarLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ButtBuscarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton3)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(490, Short.MAX_VALUE))
        );

        jScrollPane5.setViewportView(ButtBuscar);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(112, Short.MAX_VALUE)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 892, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 572, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(29, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Listar Operarios", jPanel3);

        jScrollPane6.setAutoscrolls(true);

        ButtBuscar1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Datos del Operario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Asignar rol al operario:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jLabel34.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel34.setText("Rol:");

        jComboBoxRol.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxRol.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxRolActionPerformed(evt);
            }
        });

        jLabel35.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel35.setText("Area: ");

        jLabel36.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jLabel36.setText("Cargo:");

        jComboBoxArea.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxArea.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxAreaActionPerformed(evt);
            }
        });

        jComboBoxCargo.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jComboBoxCargo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxCargoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addComponent(jLabel34)
                                .addGap(32, 32, 32)
                                .addComponent(jComboBoxRol, 0, 208, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                                .addComponent(jLabel36)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBoxCargo, 0, 208, Short.MAX_VALUE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                        .addGap(13, 13, 13)
                        .addComponent(jLabel35)
                        .addGap(18, 18, 18)
                        .addComponent(jComboBoxArea, 0, 209, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel35))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxCargo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel36))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(jComboBoxRol, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(61, 61, 61))
        );

        jButton1.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButton1.setForeground(new java.awt.Color(102, 0, 102));
        jButton1.setText("Cargar ACR");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButtonAsignarRolOperario.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButtonAsignarRolOperario.setForeground(new java.awt.Color(102, 0, 102));
        jButtonAsignarRolOperario.setText("Asignar");
        jButtonAsignarRolOperario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAsignarRolOperarioActionPerformed(evt);
            }
        });

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Area - Cargo - Rol Actual", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 12), new java.awt.Color(102, 0, 102))); // NOI18N

        jTableACR.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jTableACR.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane4.setViewportView(jTableACR);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(61, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(29, Short.MAX_VALUE))
        );

        jTableOperario.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, null, null, new java.awt.Color(153, 153, 153)));

        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, operarioList3, jTableOperario);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${apellido}"));
        columnBinding.setColumnName("Apellido");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombre}"));
        columnBinding.setColumnName("Nombre");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${numerodocumento}"));
        columnBinding.setColumnName("Numerodocumento");
        columnBinding.setColumnClass(Integer.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${telefono1}"));
        columnBinding.setColumnName("Telefono1");
        columnBinding.setColumnClass(Integer.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${direccion}"));
        columnBinding.setColumnName("Direccion");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fechaalta}"));
        columnBinding.setColumnName("Fechaalta");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fechabaja}"));
        columnBinding.setColumnName("Fechabaja");
        columnBinding.setColumnClass(String.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jTableOperario.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableOperarioMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTableOperario);

        jScrollPane7.setViewportView(jScrollPane1);

        jButtonAsignarRolOperario1.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButtonAsignarRolOperario1.setForeground(new java.awt.Color(102, 0, 102));
        jButtonAsignarRolOperario1.setText("Eliminar Rol Operario");
        jButtonAsignarRolOperario1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAsignarRolOperario1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout ButtBuscar1Layout = new javax.swing.GroupLayout(ButtBuscar1);
        ButtBuscar1.setLayout(ButtBuscar1Layout);
        ButtBuscar1Layout.setHorizontalGroup(
            ButtBuscar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ButtBuscar1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ButtBuscar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 729, Short.MAX_VALUE)
                    .addGroup(ButtBuscar1Layout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(ButtBuscar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonAsignarRolOperario)
                    .addComponent(jButton1)
                    .addComponent(jButtonAsignarRolOperario1))
                .addGap(987, 987, 987))
        );
        ButtBuscar1Layout.setVerticalGroup(
            ButtBuscar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ButtBuscar1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addGroup(ButtBuscar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(ButtBuscar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE))
                    .addGroup(ButtBuscar1Layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addGap(18, 18, 18)
                        .addComponent(jButtonAsignarRolOperario)
                        .addGap(18, 18, 18)
                        .addComponent(jButtonAsignarRolOperario1)))
                .addContainerGap(131, Short.MAX_VALUE))
        );

        jScrollPane6.setViewportView(ButtBuscar1);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 982, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 601, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Asignar Rol a Operario", jPanel8);

        jButtonSalir.setFont(new java.awt.Font("Segoe UI", 3, 12));
        jButtonSalir.setForeground(new java.awt.Color(102, 0, 102));
        jButtonSalir.setText("Salir");
        jButtonSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSalirActionPerformed(evt);
            }
        });

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED), "Usuario Registrado", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 3, 11), new java.awt.Color(102, 0, 102))); // NOI18N
        jPanel16.setForeground(new java.awt.Color(102, 0, 102));

        jTextFieldUsuario3.setEditable(false);
        jTextFieldUsuario3.setFont(new java.awt.Font("Segoe UI", 1, 11));
        jTextFieldUsuario3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTextFieldUsuario3, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTextFieldUsuario3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(28, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1019, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonSalir))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 440, Short.MAX_VALUE)
                .addComponent(jButtonSalir)
                .addGap(72, 72, 72))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 642, Short.MAX_VALUE)
                .addContainerGap())
        );

        bindingGroup.bind();

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-1270)/2, (screenSize.height-700)/2, 1270, 700);
    }// </editor-fold>//GEN-END:initComponents

    private void refresh() {
        jTextFieldapellido.setText("");
        jTextFieldnombre.setText("");
        jTextFieldnumeroDocumento.setText("");
        jTextFieldcuil.setText("");
        jTextFielddireccion.setText("");
        jTextFieldcodigoPostal.setText("");
        jTextFieldtelefono1.setText("");
        jTextFieldtelefono2.setText("");
    }

private void jTableOperariosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableOperariosMouseClicked
    cargarCampos();
}//GEN-LAST:event_jTableOperariosMouseClicked

private void jButtonSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSalirActionPerformed
    this.dispose();
}//GEN-LAST:event_jButtonSalirActionPerformed

////////////////////////////ALTA OPERARIO////////////////////////////
private void jButtonGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGuardarActionPerformed
    boolean ver = false;
    Tipodocumento tipodocper = null;
    Estadooperario estadoper = null;
    Pais paisper = null;
    Provincia provinciaper = null;
    Localidad localidadper = null;
    nombre = jTextFieldnombre.getText();
    apellido = jTextFieldapellido.getText();
    numerodoc = (jTextFieldnumeroDocumento.getText());
    direccion = jTextFielddireccion.getText();

    tipodoc = jComboBoxtipoDocumento.getSelectedItem().toString();

    try {
        tipodocper = controladortd.buscarTipoDocumentoNombre(tipodoc);

    } catch (Exception e) {
    }

    estadopersona = jComboBoxestadoPersona.getSelectedItem().toString();
    try {
        estadoper = controladorep.buscarEstadoPersonaNombre(estadopersona);
    } catch (Exception e) {
    }

    pais = jComboBoxpais.getSelectedItem().toString();

    try {
        paisper = controladorpais.buscarPaisNombre(pais);

    } catch (Exception e) {
    }

    provincia = jComboBoxprovincia.getSelectedItem().toString();

    try {
        provinciaper = controladorprov.buscarProvinciaNombre(provincia);

    } catch (Exception e) {
    }

    localidad = jComboBoxlocalidad.getSelectedItem().toString();

    try {
        localidadper = controladorlocal.buscarLocalidadNombre(localidad);

    } catch (Exception e) {
    }

//    rol = jComboBoxRol3.getSelectedItem().toString();
//
//    try {
//        rolper = controladorrol.buscarRolNombre(rol);
//
//    } catch (Exception e) {
//    }
//////////////////////////PARA INCLUIR LA FECHA ACTUAL COMO FECHA DE ALTA ////////////
//    Date fechaActual = new Date();
//    String fecha = fechaActual.toString();
//    // String fechaAlta=null;
//    Calendar calendar = Calendar.getInstance();
//
//    int dia = calendar.get(Calendar.DAY_OF_MONTH);   //dia del mes
//    int mescal = calendar.get(Calendar.MONTH);  //mes, de 0 a 11
//
//    //IF MES MENOR QUE 10 CONCATENAR UN CERO ADELANTE
//
//    mescal = mescal + 1;
//
//    int anio = calendar.get(Calendar.YEAR);  //año
//
//    String diacalendar = String.valueOf(dia);
//    String mescalendar = String.valueOf(mescal);
//
//    if (mescal < 10) {
//        mescalendar = "0" + String.valueOf(mescal);
//        System.out.println("mescalendar es:" + mescal);
//    }
//
//    String aniocalendar = String.valueOf(anio);
//    fechaAlta = diacalendar + "/" + mescalendar + "/" + aniocalendar;
       fechaAlta = Validador.getInstance().obtenerFechaSistema();
    System.out.println("La fecha de hoy es: " + fechaAlta);
    ////////////////////////////////////////////////////////////////////////////////////
    cuil = jTextFieldcuil.getText();
    codigopostal = jTextFieldcodigoPostal.getText();
    String tel1 = jTextFieldtelefono1.getText();
    String tel2 = jTextFieldtelefono2.getText();
   // telefono1 = Integer.parseInt(jTextFieldtelefono1.getText());
    //telefono2 = Integer.parseInt(jTextFieldtelefono2.getText());
    //  fechaAlta = "";
    fechaBaja = "";
    int nroDoc= Integer.parseInt(numerodoc);

    //ver = ((verificar(apellido, nombre, tipodoc, numerodoc, cuil, estadopersona, direccion, pais, provincia, localidad, codigopostal, tel1, tel2, fechaAlta, fechaBaja)) );
    if (verificar(apellido, nombre, tipodoc, numerodoc, estadopersona, direccion, pais, provincia, localidad, codigopostal, tel1, fechaAlta, fechaBaja) && (verificar(cuil))) {
        //  if (ver == true) {


        Operario ope = new Operario();
        //apellido, nombre, tipodocper, nroDoc, estadoper, direccion, paisper, provinciaper, localidadper, telefono1, telefono2, cuil, fechaAlta, fechaBaja
        ope.setApellido(apellido);
        ope.setNombre(nombre);
        ope.setTipodocumento(tipodocper);
        ope.setNumerodocumento(nroDoc);
        ope.setEstadooperario(estadoper);
        ope.setDireccion(direccion);
        ope.setPais(paisper);
        ope.setProvincia(provinciaper);
        ope.setLocalidad(localidadper);
        ope.setTelefono1(Integer.valueOf(tel1));
        ope.setTelefono2(Integer.valueOf(tel2));
        ope.setCuil(cuil);
        ope.setFechaalta(fechaAlta);
        ope.setFechabaja(fechaBaja);

   
        controladorop.guardarOperario(ope);
       

        JOptionPane.showMessageDialog(this, "Se dio de alta al Operario", "Alta", JOptionPane.INFORMATION_MESSAGE);

        refresh();
        cargarTabla();
        cargarTabla1();
        cargarComboApellido();
        //   cargarComboOperarios();//ojo este carga todos los operarios
    }
}//GEN-LAST:event_jButtonGuardarActionPerformed

    private void cargarTipoDocumento() {

        try {
            listatd = controladortd.buscarTodosTipodocumento();
        } catch (Exception e) {
        }
        jComboBoxtipoDocumento.removeAllItems();
        for (int i = 0; i < listatd.size(); i++) {
            Vector fila = new Vector();
            Tipodocumento tipo = (Tipodocumento) listatd.get(i);
            fila.add(tipo.getNombretipo());
            jComboBoxtipoDocumento.addItem(fila.get(0));
        }

    }

    private void cargarComboEstadoPersona() {

        try {
            listaep = controladorep.buscarTodosEstadoPersona();
        } catch (Exception e) {
        }
        jComboBoxestadoPersona.removeAllItems();
        for (int i = 0; i < listaep.size(); i++) {
            Vector fila = new Vector();
            Estadooperario estadopersona = (Estadooperario) listaep.get(i);
            fila.add(estadopersona.getNombre());
            jComboBoxestadoPersona.addItem(fila.get(0));
        }
    }

    private void cargarComboPaises() {

        try {
            listapais = controladorpais.buscarTodosPais();
        } catch (Exception e) {
        }
        jComboBoxpais.removeAllItems();
        for (int i = 0; i < listapais.size(); i++) {
            Vector fila = new Vector();
            Pais pais = (Pais) listapais.get(i);
            fila.add(pais.getNombrepais());
            jComboBoxpais.addItem(fila.get(0));
        }

    }

    private void cargarComboProvincias(int idpais) {

        Pais estepais = null;
        try {
            estepais = controladorpais.buscarPais_X_idPais(idpais);//el qeu traia seleccionado
            listaprov = controladorprov.buscarTodosProvincia();
        } catch (Exception e) {
        }
        jComboBoxprovincia.removeAllItems();
        for (int j = 0; j < listaprov.size(); j++) {//por cada una de todas las provincias
            Vector fila = new Vector();
            Provincia provincia = (Provincia) listaprov.get(j);
            if (provincia.getPais().equals(estepais)) {
                fila.add(provincia.getNombreprovincia());
                jComboBoxprovincia.addItem(fila.get(0));


            }
        }

    }

    private void cargarComboLocalidades(int idprovincia) {

        Provincia estaprovincia = null;
        try {
            estaprovincia = controladorprov.buscarProvincia_X_idProvincia(idprovincia);
            System.out.println(estaprovincia.getNombreprovincia());
            listaloc = controladorlocal.buscarTodosLocalidad();
        } catch (Exception e) {
        }
        jComboBoxlocalidad.removeAllItems();
        for (int i = 0; i < listaloc.size(); i++) {//para todas las localidades
            Vector fila = new Vector();
            Localidad milocalidad = (Localidad) listaloc.get(i);
            if (milocalidad.getProvincia().equals(estaprovincia)) {
                fila.add(milocalidad.getNombrelocalidad());
                jComboBoxlocalidad.addItem(fila.get(0));
            }
        }
    }

    //////////////MODIFICAR OPERARIO/////////////////////////
    private void cargarTipoDocumento1() {

        try {
            listatd = controladortd.buscarTodosTipodocumento();
        } catch (Exception e) {
        }
        jComboBoxtipoDocumento1.removeAllItems();
        for (int i = 0; i < listatd.size(); i++) {
            Vector fila = new Vector();
            Tipodocumento tipo = (Tipodocumento) listatd.get(i);
            fila.add(tipo.getNombretipo());
            jComboBoxtipoDocumento1.addItem(fila.get(0));
        }

    }

    private void cargarComboEstadoPersona1() {

        try {
            listaep = controladorep.buscarTodosEstadoPersona();
        } catch (Exception e) {
        }
        jComboBoxestadoPersona1.removeAllItems();
        for (int i = 0; i < listaep.size(); i++) {
            Vector fila = new Vector();
            Estadooperario estadopersona = (Estadooperario) listaep.get(i);
            fila.add(estadopersona.getNombre());
            jComboBoxestadoPersona1.addItem(fila.get(0));
        }
    }

    private void cargarComboPaises1() {

        try {
            listapais = controladorpais.buscarTodosPais();
        } catch (Exception e) {
        }
        jComboBoxpais1.removeAllItems();
        for (int i = 0; i < listapais.size(); i++) {
            Vector fila = new Vector();
            Pais pais = (Pais) listapais.get(i);
            fila.add(pais.getNombrepais());
            jComboBoxpais1.addItem(fila.get(0));
        }

    }

   private void cargarComboProvincias1(int idpais) {

        Pais estepais = null;
        try {
            estepais = controladorpais.buscarPais_X_idPais(idpais);//el qeu traia seleccionado
            listaprov = controladorprov.buscarTodosProvincia();
        } catch (Exception e) {
        }
        jComboBoxprovincia1.removeAllItems();
        for (int j = 0; j < listaprov.size(); j++) {//por cada una de todas las provincias
            Vector fila = new Vector();
            Provincia provincia = (Provincia) listaprov.get(j);
            if (provincia.getPais().equals(estepais)) {
                fila.add(provincia.getNombreprovincia());
                jComboBoxprovincia1.addItem(fila.get(0));


            }
        }

    }
    private void cargarComboLocalidades1(int idprovincia) {

        Provincia estaprovincia = null;
        try {
            estaprovincia = controladorprov.buscarProvincia_X_idProvincia(idprovincia);
            System.out.println(estaprovincia.getNombreprovincia());
            listaloc = controladorlocal.buscarTodosLocalidad();
        } catch (Exception e) {
        }
        jComboBoxlocalidad1.removeAllItems();
        for (int i = 0; i < listaloc.size(); i++) {//para todas las localidades
            Vector fila = new Vector();
            Localidad milocalidad = (Localidad) listaloc.get(i);
            if (milocalidad.getProvincia().equals(estaprovincia)) {
                fila.add(milocalidad.getNombrelocalidad());
                jComboBoxlocalidad1.addItem(fila.get(0));
            }
        }
    }

   

    public void actualizarDatos(Operario operarioSel) {

        jTextFieldapellido1.setText(operarioSel.getApellido());
        jTextFieldnombre1.setText(operarioSel.getNombre());
        jTextFieldcuil1.setText(operarioSel.getCuil());
        jTextFieldnumeroDocumento1.setText(String.valueOf(operarioSel.getNumerodocumento()));
        jTextFielddireccion1.setText(operarioSel.getDireccion());
        jTextFieldtelefono1.setText(String.valueOf(operarioSel.getTelefono1()));
        jTextFieldtelefono2.setText(String.valueOf(operarioSel.getTelefono2()));


    }

private void modificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modificarActionPerformed
    Tipodocumento tipodocper = null;
    Estadooperario estadoper = null;;
    Pais paisper = null;
    Provincia provinciaper = null;
    Localidad localidadper = null;
    boolean ver = false;
    int ind = jTableOperarios.getSelectedRow();
    if (ind < 0) {
        JOptionPane.showMessageDialog(this, "Seleccione un Operario", "Modificar Operario", JOptionPane.INFORMATION_MESSAGE);
    } else {

        nombre = jTextFieldnombre1.getText();
        apellido = jTextFieldapellido1.getText();

        tipodoc = jComboBoxtipoDocumento1.getSelectedItem().toString();

        try {
            tipodocper = controladortd.buscarTipoDocumentoNombre(tipodoc);

        } catch (Exception e) {
        }

        numerodoc = jTextFieldnumeroDocumento1.getText();
        direccion = jTextFielddireccion1.getText();

        estadopersona = jComboBoxestadoPersona1.getSelectedItem().toString();

        try {
            estadoper = controladorep.buscarEstadoPersonaNombre(estadopersona);

        } catch (Exception e) {
        }

        pais = jComboBoxpais1.getSelectedItem().toString();

        try {
            paisper = controladorpais.buscarPaisNombre(pais);

        } catch (Exception e) {
        }

        provincia = jComboBoxprovincia1.getSelectedItem().toString();

        try {
            provinciaper = controladorprov.buscarProvinciaNombre(provincia);

        } catch (Exception e) {
        }

        localidad = jComboBoxlocalidad1.getSelectedItem().toString();

        try {
            localidadper = controladorlocal.buscarLocalidadNombre(localidad);

        } catch (Exception e) {
        }

       // rol = jComboBoxRol1.getSelectedItem().toString();


        try {
            rolper = controladorrol.buscarRolNombre(rol);

        } catch (Exception e) {
        }
        ////////////////////

/////////////////////
        cuil = jTextFieldcuil1.getText();
        codigopostal = jTextFieldcodigoPostal1.getText();
        int tel3 = Integer.parseInt(jTextFieldtelefono3.getText());
        int tel4 = Integer.parseInt(jTextFieldtelefono4.getText());
        fechaAlta = ""; //esta fecha no se debería poder modificar
        fechaBaja = "";//esta fecha se da al eliminar
        int nroDoc= Integer.parseInt(numerodoc);

        operario = (Operario) listao.get(ind);
//apellido, nombre, tipodocper, nroDoc, estadoper, direccion, paisper, provinciaper, localidadper, telefono1, telefono2, cuil, fechaAlta, fechaBaja

        //verificar que el cuil no exista para otro operario
        if (verificar(apellido, nombre, tipodoc, numerodoc, estadopersona, direccion, pais, provincia, localidad, codigopostal, jTextFieldtelefono3.getText(), fechaAlta, fechaBaja) && verificar2(cuil)) {
           operario.setApellido(apellido);
                operario.setNombre(nombre);
                operario.setTipodocumento(tipodocper);
                operario.setNumerodocumento(nroDoc);
                operario.setDireccion(direccion);
                operario.setEstadooperario(estadoper);
                operario.setPais(paisper);
                operario.setProvincia(provinciaper);
                operario.setLocalidad(localidadper);

                operario.setTelefono1(tel3);
                operario.setTelefono2(tel4);
                operario.setCuil(cuil);
                operario.setFechaalta(fechaAlta);
                operario.setFechabaja(fechaBaja);

            try {
                controladorop.modificarOperario(operario);

            } catch (Exception ex) {
                ex.printStackTrace();
            }
            JOptionPane.showMessageDialog(this, "Se modificó el Operario", "Modificar Operario", JOptionPane.INFORMATION_MESSAGE);
            cargarTabla();
        }
    }

}//GEN-LAST:event_modificarActionPerformed

private void jTextFieldapellido1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldapellido1ActionPerformed
}//GEN-LAST:event_jTextFieldapellido1ActionPerformed
    private void cargarCampos() {
      limpiarCampos();
        int fila = jTableOperarios.getSelectedRow();
        System.out.println(fila + " fila");
        Estadooperario esteestado = null;
        int nroestado;
        int nropais;
        int nroprov;
        int nroloc;
        int nrotipo;

        Operario operario = new Operario();
        operario = (Operario) listaoactivo.get(fila);
        jTextFieldapellido1.setText(operario.getApellido());
        jTextFieldnombre1.setText(operario.getNombre());
        jTextFieldcuil1.setText(operario.getCuil());
//Estadopersona
        nroestado = operario.getEstadooperario().getIdestadooperario();

        String nro = String.valueOf(nroestado);
        int nroEstado = Integer.parseInt(nro) - 1;//es menos 1 por el indice que empieza en cero
        jComboBoxestadoPersona1.setSelectedIndex(nroEstado);


        jTextFieldnumeroDocumento1.setText(String.valueOf(operario.getNumerodocumento()));
//Pais
      /*
        nropais = operario.getPais().getIdpais();
        String npais = String.valueOf(nropais);
        int nroPais = Integer.parseInt(npais) - 1;
        jComboBoxpais1.setSelectedIndex(nroPais);
//provincia
        nroprov = operario.getProvincia().getIdprovincia();
        String nprov = String.valueOf(nroprov);
        int nroProv = Integer.parseInt(nprov) - 1;
        jComboBoxprovincia1.setSelectedIndex(nroProv);
//Localidad
        nroloc = operario.getLocalidad().getIdlocalidad();
        String nloc = String.valueOf(nroloc);
        int nroLoc = Integer.parseInt(nloc) - 1;
        jComboBoxlocalidad1.setSelectedIndex(nroLoc);*/

        
        jTextFielddireccion1.setText(operario.getDireccion());

        jTextFieldcodigoPostal1.setText(operario.getLocalidad().getCodigopostal());

        jTextFieldtelefono3.setText(String.valueOf(operario.getTelefono1()));

        jTextFieldtelefono4.setText(String.valueOf(operario.getTelefono2()));
    }

    private void cargarTabla() {

        String[] encabezados = new String[7];
        encabezados[0] = "Apellido";
        encabezados[1] = "Nombre";
        encabezados[2] = "Nro Documento";
        encabezados[3] = "Nro Telefono1";
        encabezados[4] = "Pais";
        encabezados[5] = "Provincia";
        encabezados[6] = "Localidad";
        tableModel = new TablaPersonalizada(encabezados);
        jTableOperarios.setModel(tableModel);

        try {
            listaoactivo = controladorop.buscarOperarioActivo();
            System.out.println("tamaño de listaoactivo" + listaoactivo.size());

            for (int i = 0; i < listaoactivo.size(); i++) {
                 Operario operarios = (Operario) listaoactivo.get(i);
                


                 
                      Vector fila = new Vector();
                fila.add(operarios.getApellido());
                fila.add(operarios.getNombre());
                fila.add(operarios.getNumerodocumento());
                fila.add(operarios.getTelefono1());
                fila.add(operarios.getPais().getNombrepais());
                fila.add(operarios.getProvincia().getNombreprovincia());
                fila.add(operarios.getLocalidad().getNombrelocalidad());
                tableModel.addRow(fila);
            }
            
        } catch (Exception e) {
        }
    }
private void cargarTabla1() {

        String[] encabezados = new String[4];
        encabezados[0] = "Apellido";
        encabezados[1] = "Nombre";
        encabezados[2] = "D.N.I";
        encabezados[3] = "Fecha Alta";

        tableModel = new TablaPersonalizada(encabezados);
        jTableOperario.setModel(tableModel);

        try {
            listaoactivo = controladorop.buscarOperarioActivo();
            System.out.println("tamaño de listaoactivo" + listaoactivo.size());

            for (int i = 0; i < listaoactivo.size(); i++) {
                 Operario operarios = (Operario) listaoactivo.get(i);




                      Vector fila = new Vector();
                fila.add(operarios.getApellido());
                fila.add(operarios.getNombre());
                fila.add(operarios.getNumerodocumento());
                fila.add(operarios.getFechaalta());
                tableModel.addRow(fila);
            }

        } catch (Exception e) {
        }
    }

    private void limpiarCampos() {
        jTextFieldapellido1.setText("");
        jTextFieldnombre1.setText("");
        jTextFielddireccion1.setText("");
        jTextFieldcodigoPostal1.setText("");
        jTextFieldcuil1.setText("");
        jTextFieldnumeroDocumento1.setText("");
        jTextFieldtelefono3.setText("");
        jTextFieldtelefono4.setText("");
       
    }

///////////////////ELIMINAR OPERARIO////////////////////////////////////////
////////////////////LISTAR OPERARIO///////////////////////////////////////
    private void cargarComboApellido() {
        try {
            listao = controladorop.buscarOperarioActivo();
            System.out.println("tamaño de la lista de operarios " + listao.size());
        } catch (Exception e) {
        }
        jComboBoxCuil.removeAllItems();
        for (int i = 0; i < listao.size(); i++) {
            Vector fila = new Vector();
            Operario operari = (Operario) listao.get(i);
            fila.add(operari.getApellido());
            jComboBoxCuil.addItem(fila.get(0));
        }
    }
/*private void cargarComboApellidoRol() {
        try {
            listao = controladorop.buscarTodosOperario();
            System.out.println("tamaño de la lista de operarios " + listao.size());
        } catch (Exception e) {
        }
        jComboBoxCuil1.removeAllItems();
        for (int i = 0; i < listao.size(); i++) {
            Vector fila = new Vector();
            Operario operari = (Operario) listao.get(i);
            fila.add(operari.getApellido());
            jComboBoxCuil1.addItem(fila.get(0));
        }
    }*/
private void jButtonBuscarConActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBuscarConActionPerformed
///////////////
    System.out.println("");
    Operario mioperar = null;
    Object esteoperar = jComboBoxCuil.getSelectedItem();
    String operarioapellido = esteoperar.toString();
    System.out.println("nombre cuil " + operarioapellido);
    try {
        mioperar = controladorop.buscarOperarioApellido(operarioapellido);
        System.out.println("mioperar " + mioperar);
    } catch (Exception e) {
        JOptionPane.showMessageDialog(this, "El operario ingresado no se ha encontrado.\n ", "Operarios", JOptionPane.ERROR_MESSAGE);
    }

    if (mioperar != null) {

        jTextFieldNombreListar.setText(mioperar.getCuil());
        jTextFielTelefono.setText(String.valueOf(mioperar.getNumerodocumento()));
        txtDireccionCon.setText(mioperar.getDireccion());
        jTextFielcuil.setText(String.valueOf(mioperar.getNombre()));
        jTextField1.setText(String.valueOf(mioperar.getTelefono1()));
    }
}//GEN-LAST:event_jButtonBuscarConActionPerformed

/////////////////ALTA OPERARIO/////////////////////////////
//este da error porque devuelve nulo ya que no hay ninguna provincia seleccionada da nul pointer exception/*    public void mostrarCodigoPostal1(String codigo) {
    
private void jComboBoxtipoDocumentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxtipoDocumentoActionPerformed

    Tipodocumento mitipodoc = null;
    Object estedoc = jComboBoxtipoDocumento.getSelectedItem();
    String nombretipodoc = estedoc.toString();//nombre del pais
    try {
        mitipodoc = controladortd.buscarTipoDocumentoNombre(nombretipodoc);
    } catch (Exception e) {
    }

}//GEN-LAST:event_jComboBoxtipoDocumentoActionPerformed

private void jComboBoxestadoPersonaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxestadoPersonaActionPerformed


    Estadooperario miestado = null;
    Object esteestado = jComboBoxestadoPersona.getSelectedItem();
    String nombreestadopers = esteestado.toString();//nombre del pais
    try {
        miestado = controladorep.buscarEstadoPersonaNombre(nombreestadopers);
    } catch (Exception e) {
    }
}//GEN-LAST:event_jComboBoxestadoPersonaActionPerformed

/////////////////LISTAR////////////////////
private void jComboBoxCuilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxCuilActionPerformed
}//GEN-LAST:event_jComboBoxCuilActionPerformed

private void jTextFieldtelefono4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldtelefono4ActionPerformed
    // TODO add your handling code here:
}//GEN-LAST:event_jTextFieldtelefono4ActionPerformed

private void jComboBoxCuilMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxCuilMousePressed
//limpiarDatos();    // TODO add your handling code here:
cargarComboApellido();
}//GEN-LAST:event_jComboBoxCuilMousePressed

private void jComboBoxlocalidad1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxlocalidad1MousePressed
    // TODO add your handlin
}//GEN-LAST:event_jComboBoxlocalidad1MousePressed

private void jButtonAsignarRolOperarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAsignarRolOperarioActionPerformed
  int fila = jTableOperario.getSelectedRow();
        Operario op= new Operario();
        Operariorol operol = new Operariorol();
       // op = (Operario) operarioList.get(fila);
       // List opeacr = (List) controperariorol.buscarOperariorol_X_idOperario(op.getIdoperario());
       // System.out.println("opeacr"+opeacr);
      
       
        

    //  new Operariorol(areaper, cargoper,operario,rolper, fechaAlta, fechaAlta);
    //pero con los datos de areacargo sin
    Date fechaActual = new Date();
    String fecha = fechaActual.toString();
    // String fechaAlta=null;
    Calendar calendar = Calendar.getInstance();

    int dia = calendar.get(Calendar.DAY_OF_MONTH);   //dia del mes
    int mescal = calendar.get(Calendar.MONTH);  //mes, de 0 a 11

    //IF MES MENOR QUE 10 CONCATENAR UN CERO ADELANTE

    mescal = mescal + 1;

    int anio = calendar.get(Calendar.YEAR);  //año

    String diacalendar = String.valueOf(dia);
    String mescalendar = String.valueOf(mescal);

    if (mescal < 10) {
        mescalendar = "0" + String.valueOf(mescal);
        System.out.println("mescalendar es:" + mescal);
    }

    String aniocalendar = String.valueOf(anio);
    fechaAlta = diacalendar + "/" + mescalendar + "/" + aniocalendar;
    System.out.println("La fecha de hoy es: " + fechaAlta);
    //////////////
  //  Operariorol operol = new Operariorol();
    String a = jComboBoxArea.getSelectedItem().toString();
    String c = jComboBoxCargo.getSelectedItem().toString();
    String r = jComboBoxRol.getSelectedItem().toString();
        try {
            areaper = controladorarea.buscarAreaNombre(a);

        } catch (Exception ex) {
            Logger.getLogger(ABMOperario.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            cargoper = controladorcargo.buscarCargoNombre(c);
          
        } catch (Exception ex) {
            Logger.getLogger(ABMOperario.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            rolper = controladorrol.buscarRolNombre(r);
          
        } catch (Exception ex) {
            Logger.getLogger(ABMOperario.class.getName()).log(Level.SEVERE, null, ex);
        }
    op= listaoactivo.get(fila);
     
   
   boolean ver = controperariorol.BuscarACR(areaper, cargoper, rolper,op );


  
           if(ver ){
               JOptionPane.showMessageDialog(this, "Asignación ya realizada", "Operario Rol", JOptionPane.ERROR_MESSAGE);
           }else{
       
    
    operol.setOperario(op);
     operol.setArea( areaper);
    operol.setCargo(cargoper);
    operol.setRol( rolper);
    operol.setFechainicio(fechaAlta);
    // operol.setFechafin("");
 //   operol.setOperario(operario);


    try {
        controperariorol.guardarOperariorol(operol);
        System.out.println("despues de crearlo: " + operol);
        JOptionPane.showMessageDialog(this, "Asignación realizada", "Operario Rol", JOptionPane.INFORMATION_MESSAGE);
    } catch (Exception e) {
        System.out.println(e);
    }
cargarTablaAreaCargoRol();
    }
}//GEN-LAST:event_jButtonAsignarRolOperarioActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    cargarComboArea();
    cargarComboCargo();
    cargarComboRol();// TODO add your handling code here:
    jButtonAsignarRolOperario.setVisible(true);
}//GEN-LAST:event_jButton1ActionPerformed

private void jComboBoxCargoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxCargoActionPerformed

    Object estecargo = jComboBoxCargo.getSelectedItem();
    String nombrecargo = estecargo.toString();//nombre del pais
    try {
        cargoper = controladorcargo.buscarCargoNombre(nombrecargo);
    } catch (Exception e) {
    }

    // cargarComboRol(cargoper.getIdCargo());//donde los roles que se carguen pertenezcan al cargo
    // TODO add your handling code here:
}//GEN-LAST:event_jComboBoxCargoActionPerformed

private void jComboBoxAreaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxAreaActionPerformed
    // Area miarea = null;
    Object estaarea = jComboBoxArea.getSelectedItem();
    String nombrearea = estaarea.toString();//nombre del pais
    try {
        areaper = controladorarea.buscarAreaNombre(nombrearea);
    } catch (Exception e) {
    }

    //cargarComboCargo(miarea.getIdArea());//donde los cargos  que se carguen pertenezcan al area seleccionada
}//GEN-LAST:event_jComboBoxAreaActionPerformed

private void jComboBoxRolActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxRolActionPerformed
    Object esterol = jComboBoxRol.getSelectedItem();
    String nombrerol = esterol.toString();//nombre del pais
    try {
        rolper = controladorrol.buscarRolNombre(nombrerol);
    } catch (Exception e) {
    }
}//GEN-LAST:event_jComboBoxRolActionPerformed

private void jTableOperarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableOperarioMouseClicked
cargarTablaAreaCargoRol();    // TODO add your handling code here:
}//GEN-LAST:event_jTableOperarioMouseClicked

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
jPanel4.setVisible(true);    // TODO add your handling code here:;
}//GEN-LAST:event_jButton2ActionPerformed

private void eliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_eliminarActionPerformed
    int ind = jTableOperarios.getSelectedRow();
    if (ind < 0) {
        JOptionPane.showMessageDialog(this, "Seleccione un Operario", "Consulta Operarios", JOptionPane.INFORMATION_MESSAGE);
    } else {
        Operario u = (Operario) listao.get(ind);
        int rta = JOptionPane.showConfirmDialog(this, "Esta seguro de que desea ELIMINAR el Operario:\n Cuil = " + u.getCuil() + " ?", "Eliminar Operario", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
        if (rta == 0) {
            try {
                Operario o = controladorop.buscarOperario_X_idOperario(u.getIdoperario());
                fechaBaja = validador.getInstance().obtenerFechaSistema();
                o.setFechabaja(fechaBaja);
                controladorop.modificarOperario(o);
cargarTabla();
            limpiarCampos();

            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "No se puede eliminar este operario se incluirá esta fecha como fecha de baja", "Eliminar Operarios", JOptionPane.INFORMATION_MESSAGE);
            }

           
            
        }
        
    }
}//GEN-LAST:event_eliminarActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
jPanel7.setVisible(true);    // TODO add your handling code here:
cargarTablaOperariosbaja();
}//GEN-LAST:event_jButton3ActionPerformed

private void jButtonAsignarRolOperario1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAsignarRolOperario1ActionPerformed
    eliminarRolDeOperario();
}//GEN-LAST:event_jButtonAsignarRolOperario1ActionPerformed
//////////////////LISTAR///////////////
//Ojo qeu no verifica bien el telefono. da error cuando se ingresa una letra.

    private boolean verificar(String ape, String nom, String tipodoc, String nrodoc, String estadoper, String direccion, String pais, String provincia, String localidad, String codigopostal, String telefono1, String fechaAlta, String fechaBaja) {

        boolean ver = false;
        if (ape.equals("") || nom.equals("") || tipodoc.equals("") || nrodoc.equals("") || estadoper.equals("") || direccion.equals("") || pais.equals("") || provincia.equals("") || localidad.equals("") || codigopostal.equals("") || telefono1.equals("") ) {
            JOptionPane.showMessageDialog(this, "Complete todos los campos", "Error", JOptionPane.ERROR_MESSAGE);

        } else if (!validador.getInstance().soloContieneLetras(ape)) {
            JOptionPane.showMessageDialog(this, "Apellido no valido", "Error", JOptionPane.ERROR_MESSAGE);

        } else if (!validador.getInstance().soloContieneLetrasYEspacios(nom)) {
            JOptionPane.showMessageDialog(this, "Nombre no válido", "Error", JOptionPane.ERROR_MESSAGE);

        } else if (!validador.getInstance().soloContieneNumeros(nrodoc)) {
            JOptionPane.showMessageDialog(this, "Número de documento no válido", "Error", JOptionPane.ERROR_MESSAGE);

//        } else if (!validador.getInstance().soloContieneNumerosYGuiones(cuil)) {
//            JOptionPane.showMessageDialog(this, "Cuil invalida!!!", "Error", JOptionPane.ERROR_MESSAGE);

        } else if (!validador.getInstance().soloContieneLetrasYNumerosYEspacios(direccion)) {

            JOptionPane.showMessageDialog(this, "Dirección no válida", "Error", JOptionPane.ERROR_MESSAGE);

        } else if (!validador.getInstance().esTelefonoValido(telefono1)) {
            JOptionPane.showMessageDialog(this, "El valor ingresado para telefono1 es incorrecto", "Error", JOptionPane.ERROR_MESSAGE);

//        } else if (!validador.getInstance().esTelefonoValido(telefono2)) {
//            JOptionPane.showMessageDialog(this, "El valor ingresado para telefono2 es incorrecto!!!", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            ver = true;
        }
        return ver;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel ButtBuscar;
    private javax.swing.JPanel ButtBuscar1;
    private javax.persistence.EntityManager GestorPesajeJpaPU2EntityManager;
    private javax.swing.JButton eliminar;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButtonAsignarRolOperario;
    private javax.swing.JButton jButtonAsignarRolOperario1;
    private javax.swing.JButton jButtonBuscarCon;
    private javax.swing.JButton jButtonGuardar;
    private javax.swing.JButton jButtonSalir;
    private javax.swing.JComboBox jComboBoxArea;
    private javax.swing.JComboBox jComboBoxCargo;
    private javax.swing.JComboBox jComboBoxCuil;
    private javax.swing.JComboBox jComboBoxRol;
    private javax.swing.JComboBox jComboBoxestadoPersona;
    private javax.swing.JComboBox jComboBoxestadoPersona1;
    private javax.swing.JComboBox jComboBoxlocalidad;
    private javax.swing.JComboBox jComboBoxlocalidad1;
    private javax.swing.JComboBox jComboBoxpais;
    private javax.swing.JComboBox jComboBoxpais1;
    private javax.swing.JComboBox jComboBoxprovincia;
    private javax.swing.JComboBox jComboBoxprovincia1;
    private javax.swing.JComboBox jComboBoxtipoDocumento;
    private javax.swing.JComboBox jComboBoxtipoDocumento1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelApellidoCon;
    private javax.swing.JLabel jLabelDireccionCon;
    private javax.swing.JLabel jLabelDniCon;
    private javax.swing.JLabel jLabelTelCon;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTableACR;
    private javax.swing.JTable jTableOB;
    private javax.swing.JTable jTableOperario;
    private javax.swing.JTable jTableOperarios;
    private javax.swing.JTextField jTextFielTelefono;
    private javax.swing.JTextField jTextFielcuil;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextFieldNombreListar;
    private javax.swing.JTextField jTextFieldUsuario3;
    private javax.swing.JTextField jTextFieldapellido;
    private javax.swing.JTextField jTextFieldapellido1;
    private javax.swing.JTextField jTextFieldcodigoPostal;
    private javax.swing.JTextField jTextFieldcodigoPostal1;
    private javax.swing.JTextField jTextFieldcuil;
    private javax.swing.JTextField jTextFieldcuil1;
    private javax.swing.JTextField jTextFielddireccion;
    private javax.swing.JTextField jTextFielddireccion1;
    private javax.swing.JTextField jTextFieldnombre;
    private javax.swing.JTextField jTextFieldnombre1;
    private javax.swing.JTextField jTextFieldnumeroDocumento;
    private javax.swing.JTextField jTextFieldnumeroDocumento1;
    private javax.swing.JTextField jTextFieldtelefono1;
    private javax.swing.JTextField jTextFieldtelefono2;
    private javax.swing.JTextField jTextFieldtelefono3;
    private javax.swing.JTextField jTextFieldtelefono4;
    private java.util.List<Entidades.Localidad> localidadList;
    private javax.persistence.Query localidadQuery;
    private javax.swing.JButton modificar;
    private java.util.List<Entidades.Operario> operarioList;
    private java.util.List<Entidades.Operario> operarioList1;
    private java.util.List<Entidades.Operario> operarioList2;
    private java.util.List<Entidades.Operario> operarioList3;
    private javax.persistence.Query operarioQuery;
    private javax.persistence.Query operarioQuery1;
    private javax.persistence.Query operarioQuery2;
    private javax.persistence.Query operarioQuery3;
    private java.util.List<Entidades.Operariorol> operariorolList;
    private javax.persistence.Query operariorolQuery;
    private java.util.List<Entidades.Tipodocumento> tipodocumentoList;
    private javax.persistence.Query tipodocumentoQuery;
    private javax.swing.JTextField txtDireccionCon;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

    private boolean verificar(String cuil) {
        boolean ver = false;

        if (cuil.equals("")) {
            JOptionPane.showMessageDialog(this, "Por favor ingrese el cuil del operario", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (!validador.getInstance().soloContieneNumerosYGuiones(cuil)) {
            JOptionPane.showMessageDialog(this, "Cuil incorrecto: Ingrese números y guiones para cuil", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (!repetidoOperario(cuil) == false) {
            JOptionPane.showMessageDialog(this, "Error el numero de cuil pertenece a otro operario ", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            ver = true;
        }

        return ver;
    }
    private boolean verificar2(String cuil) {
        boolean ver = false;

        if (cuil.equals("")) {
            JOptionPane.showMessageDialog(this, "Por favor ingrese el cuil del operario", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (!validador.getInstance().soloContieneNumerosYGuiones(cuil)) {
            JOptionPane.showMessageDialog(this, "Cuil incorrecto: Ingrese números y guiones para cuil", "Error", JOptionPane.ERROR_MESSAGE);
       // } else if (!repetidoOperario(cuil) == false) {
       //     JOptionPane.showMessageDialog(this, "Error el numero de cuil pertenece a otro operario !!!", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            ver = true;
        }

        return ver;
    }

    private boolean repetidoOperario(String cuil) {
        boolean estarepetido = false;
        Operario operarc = new Operario();
        try {
            operarc = controladorop.buscarOperarioCuil(cuil);
            estarepetido = true;
            System.out.println("Encontró el cuil en un operario");
        } catch (Exception e) {
            estarepetido = false;
            System.out.println("NO está repetido el cuil en otro operario");
        }
        return estarepetido;
    }

    private void cargarComboRol() {
        try {
            listarol = controladorrol.buscarTodosRol();
        } catch (Exception e) {
        }
        jComboBoxRol.removeAllItems();
        for (int i = 0; i < listarol.size(); i++) {
            Vector fila = new Vector();
            Rol rol = (Rol) listarol.get(i);
            fila.add(rol.getNombreRol());
            jComboBoxRol.addItem(fila.get(0));
        }

    }

  /*  private void cargarComboCuil1() {
        try {
            listao = controladorop.buscarTodosOperario();
            System.out.println("tamaño de la lista de cuil 1: " + listao.size());
        } catch (Exception e) {
        }
        jComboBoxCuil1.removeAllItems();
        for (int i = 0; i < listao.size(); i++) {
            Vector fila = new Vector();
            Operario operari = (Operario) listao.get(i);
            fila.add(operari.getCuil());
            jComboBoxCuil1.addItem(fila.get(0));
        }
    }*/

    private void cargarComboArea() {
        try {
            listaarea = controladorarea.buscarTodosArea();
            System.out.println("tamaño de listaarea: " + listaarea.size());
        } catch (Exception e) {
        }
        jComboBoxArea.removeAllItems();
        for (int i = 0; i < listaarea.size(); i++) {
            Vector fila = new Vector();
            Area area = (Area) listaarea.get(i);
            fila.add(area.getNombreArea());
            jComboBoxArea.addItem(fila.get(0));
        }

    }

    private void cargarComboCargo() {
        try {
            listacargo = controladorcargo.buscarTodosCargo();
            System.out.println("tamaño de listacargo: " + listaarea.size());
        } catch (Exception e) {
        }
        jComboBoxCargo.removeAllItems();
        for (int i = 0; i < listacargo.size(); i++) {
            Vector fila = new Vector();
            Cargo cargo = (Cargo) listacargo.get(i);
            fila.add(cargo.getNombreCargo());
            jComboBoxCargo.addItem(fila.get(0));
        }

    }

   /* private void limpiarDatos() {
        jTextFielapellido1.setText("");
        jTextFieldNombreListar1.setText("");
        jTextFielNroDoc1.setText("");
        txtDireccionCon1.setText("");
        AreaField.setText("");
        CargoField.setText("");
        RolField.setText("");
    }*/

  /*  private void cargarComboProvincias1(Integer idpais) {

        Pais estepais = null;
        try {
            estepais = controladorpais.buscarPais_X_idPais(idpais);//el qeu traia seleccionado
            listaprov = controladorprov.buscarTodosProvincia();
        } catch (Exception e) {
        }
        jComboBoxprovincia1.removeAllItems();
        for (int j = 0; j < listaprov.size(); j++) {//por cada una de todas las provincias
            Vector fila = new Vector();
            Provincia provincia = (Provincia) listaprov.get(j);
            if (provincia.getPais().equals(estepais)) {
                fila.add(provincia.getNombreprovincia());
                jComboBoxprovincia1.addItem(fila.get(0));
            }
        }


    }*/

   /* private void cargarComboLocalidades1(Integer idprovincia) {
        Provincia estaprovincia = null;
        try {
            estaprovincia = controladorprov.buscarProvincia_X_idProvincia(idprovincia);
            System.out.println(estaprovincia.getNombreprovincia());
            listaloc = controladorlocal.buscarTodosLocalidad();
        } catch (Exception e) {
        }
        jComboBoxlocalidad1.removeAllItems();
        for (int i = 0; i < listaloc.size(); i++) {//para todas las localidades
            Vector fila = new Vector();
            Localidad milocalidad = (Localidad) listaloc.get(i);
            if (milocalidad.getProvincia().equals(estaprovincia)) {
                fila.add(milocalidad.getNombrelocalidad());
                jComboBoxlocalidad1.addItem(fila.get(0));
                mostrarCodigoPostal1(milocalidad.getCodigopostal());
            }
        }
    }*/

/*    private void mostrarCodigoPostal(String codigopostal) {
        jTextFieldcodigoPostal.setText(codigopostal);
    }*/

    private void cargarComboProvincias() {
       try {
            listaprov = controladorprov.buscarTodosProvincia();
        } catch (Exception e) {
        }
        jComboBoxprovincia.removeAllItems();
        for (int i = 0; i < listaprov.size(); i++) {
            Vector fila = new Vector();
            Provincia provincia = (Provincia) listaprov.get(i);
            fila.add(provincia.getNombreprovincia());
            jComboBoxprovincia.addItem(fila.get(0));
        }
    //}
    }

    private void cargarComboLocalidades() {
        try {
            listaloc = controladorlocal.buscarTodosLocalidad();
        } catch (Exception e) {
        }
        jComboBoxlocalidad.removeAllItems();
        for (int i = 0; i < listaloc.size(); i++) {
            Vector fila = new Vector();
            Localidad localidad = (Localidad) listaloc.get(i);
            fila.add(localidad.getNombrelocalidad());
            jComboBoxlocalidad.addItem(fila.get(0));
            
        }
    }

    private void buscarLocalidades() {
      Provincia miprovincia = null;
 Object estaprovincia = jComboBoxprovincia.getSelectedItem();
    String nombreprovincia = estaprovincia.toString();
    try {
        miprovincia = controladorprov.buscarProvinciaNombre(nombreprovincia);
    } catch (Exception e) {
    }



    cargarComboLocalidades(miprovincia.getIdprovincia());
    }

    private void buscarCP() {
        Localidad mislocalidades = null;
    Object estalocalidad = jComboBoxlocalidad.getSelectedItem();
    System.out.println(estalocalidad.toString());
    try {
        mislocalidades = controladorlocal.buscarLocalidadNombre(estalocalidad.toString());
    } catch (Exception e) {
        System.out.println(e);

    }
   //

    }

//    private void cargarComboRol2() {
//        try {
//            listarol = controladorrol.buscarTodosRol();
//        } catch (Exception e) {
//        }
//        jComboBoxRol.removeAllItems();
//        for (int i = 0; i < listarol.size(); i++) {
//            Vector fila = new Vector();
//            Rol rol = (Rol) listarol.get(i);
//            fila.add(rol.getNombreRol());
//            jComboBoxRol.addItem(fila.get(0));
//        }
//    }

//    private void cargarComboRol(int idcargo) {
//         Cargo estecargo = null;
//        try {
//            estecargo = controladorcargo.buscarCargo_X_idCargo(idcargo);//el qeu traia seleccionado
//            listarol = controladorrol.buscarTodosRol();
//        } catch (Exception e) {
//        }
//        jComboBoxRol.removeAllItems();
//        for (int j = 0; j < listarol.size(); j++) {//por cada una de todas las provincias
//            Vector fila = new Vector();
//            Rol rol = (Rol) listarol.get(j);
//            if (rol.getIdRol().equals(estecargo)) {
//                fila.add(rol.getNombreRol());
//                jComboBoxRol.addItem(fila.get(0));
//            }
//        }
//   }

//    private void cargarComboCargo(int idArea) {
//       Area estaarea = null;
//        try {
//            estaarea = controladorarea.buscarArea_X_idArea(idArea);//el qeu traia seleccionado
//            listacargo = controladorcargo.buscarTodosCargo();
//        } catch (Exception e) {
//        }
//        jComboBoxCargo.removeAllItems();
//        for (int j = 0; j < listacargo.size(); j++) {//
//            Vector fila = new Vector();
//            Cargo cargo = (Cargo) listacargo.get(j);
//            if (cargo.getIdCargo().equals(estaarea)) {
//                fila.add(cargo.getNombreCargo());
//                jComboBoxCargo.addItem(fila.get(0));
//            }
//        }
//    }

   /* private void jComboBoxprovinciaItemStateChanged(java.awt.event.ItemEvent evt)
{
  String provincia = jComboBoxprovincia.getSelectedItem().toString();
  Provincia prov;
        try {
            prov = controladorprov.buscarProvinciaNombre(provincia); //Precio de ejemplo
            //Obtenemos un pais seleccionado en el combobox, ejemplo: "Pais x"
            if(evt.getItem().toString().equals(prov) )  // Si cumple obtenemos su precio
    cargarComboLocalidades(prov.getIdprovincia());//Agregamos el precio al jTextField1
        } catch (Exception ex) {
            Logger.getLogger(ABMOperario.class.getName()).log(Level.SEVERE, null, ex);
        }

}*/
 private void rellenaCombo2(String pais) {
     Pais mipais = null;
   // Object estepais = jComboBoxpais.getSelectedItem();
    String nombrepais = pais;//nombre del pais
    try {
        mipais = controladorpais.buscarPaisNombre(nombrepais);
    } catch (Exception e) {
    }

    cargarComboProvincias(mipais.getIdpais());//donde las provincias que se carguen pertenezcan al pais seleccionado

   //  Provincia miprovincia = null;
 
  /*  String nombreprovincia = estaprovincia.toString();
    try {
        miprovincia = controladorprov.buscarProvinciaNombre(nombreprovincia);
    } catch (Exception e) {
    }
//Object estaprovincia = jComboBoxprovincia.getSelectedItem();*/
 //


    

            }
  private void rellenaCombo3(String provincia) {
      Provincia miprovincia = null;
// Object estaprovincia = jComboBoxprovincia.getSelectedItem();
    String nombreprovincia = provincia;
    try {
        miprovincia = controladorprov.buscarProvinciaNombre(nombreprovincia);
        cargarComboLocalidades(miprovincia.getIdprovincia());
    } catch (Exception e) {
    }
               
    /* Localidad mislocalidades = null;
    Object estalocalidad = jComboBoxlocalidad.getSelectedItem();
    System.out.println(estalocalidad.toString());
    try {
        mislocalidades = controladorlocal.buscarLocalidadNombre(estalocalidad.toString());
    } catch (Exception e) {
        System.out.println(e);
    }
    mostrarCodigoPostal(mislocalidades.getCodigopostal());*/
            }

  private void rellenaCombo4(String loc) {
               Localidad mislocalidades = null;
    Object estalocalidad = loc;
    String codigopostal = "";
    //System.out.println(estalocalidad.toString());
    try {
        mislocalidades = controladorlocal.buscarLocalidadNombre(estalocalidad.toString());
        codigopostal = mislocalidades.getCodigopostal();
         jTextFieldcodigoPostal.setText(codigopostal);
    } catch (Exception e) {
        System.out.println(e);
    }
   
            }


   private void rellenaCombo5(String pais) {
     Pais mipais1 = null;
   // Object estepais = jComboBoxpais.getSelectedItem();
    String nombrepais1 = pais;//nombre del pais
    try {
        mipais1 = controladorpais.buscarPaisNombre(nombrepais1);
    } catch (Exception e) {
    }

    cargarComboProvincias1(mipais1.getIdpais());//donde las provincias que se carguen pertenezcan al pais seleccionado

   //  Provincia miprovincia = null;

  /*  String nombreprovincia = estaprovincia.toString();
    try {
        miprovincia = controladorprov.buscarProvinciaNombre(nombreprovincia);
    } catch (Exception e) {
    }
//Object estaprovincia = jComboBoxprovincia.getSelectedItem();*/
 //




            }
  private void rellenaCombo6(String provincia) {
      Provincia miprovincia1 = null;
// Object estaprovincia = jComboBoxprovincia.getSelectedItem();
    String nombreprovincia1 = provincia;
    try {
        miprovincia1 = controladorprov.buscarProvinciaNombre(nombreprovincia1);
        cargarComboLocalidades1(miprovincia1.getIdprovincia());
    } catch (Exception e) {
    }

    /* Localidad mislocalidades = null;
    Object estalocalidad = jComboBoxlocalidad.getSelectedItem();
    System.out.println(estalocalidad.toString());
    try {
        mislocalidades = controladorlocal.buscarLocalidadNombre(estalocalidad.toString());
    } catch (Exception e) {
        System.out.println(e);
    }
    mostrarCodigoPostal(mislocalidades.getCodigopostal());*/
            }

  private void rellenaCombo7(String loc) {
               Localidad mislocalidades1 = null;
    Object estalocalidad1 = loc;
    String codigopostal1 = "";
    //System.out.println(estalocalidad.toString());
    try {
        mislocalidades1 = controladorlocal.buscarLocalidadNombre(estalocalidad1.toString());
        codigopostal1 = mislocalidades1.getCodigopostal();
         jTextFieldcodigoPostal1.setText(codigopostal1);
    } catch (Exception e) {
        System.out.println(e);
    }
            }

    private void cargarComboApellido1() {
        throw new UnsupportedOperationException("Not yet implemented");
    }

    private void cargarTablaAreaCargoRol() {
          int fila = jTableOperario.getSelectedRow();
        Operario op= new Operario();
        Operariorol operol = new Operariorol();
        op = (Operario) listaoactivo.get(fila);
        System.out.println(op.getApellido() + ": apellido");

        //Contrato p=(Contrato) controladorcontrato.buscarContrato_X_proveedor(c.getProveedor().getIdProveedor());
         listaOperol = (List<Operariorol>) controperariorol.buscarOperariorol_X_idOperario(op.getIdoperario());
        //   el=controladorestlag.findLagar(l);
        // System.out.println(p+": buscar contr por prov");
        System.out.println(listaOperol + ": listaOperol");



        String[] encabezados = new String[3];
        encabezados[0] = "Rol";
        encabezados[1] = "Cargo";
        encabezados[2] = "Area";


        tableModel = new TablaPersonalizada(encabezados);
        jTableACR.setModel(tableModel);

        try {
            //String prov=contratoList1.
            // lista = (List) detc;
            //System.out.println("tamaño de listao" + lista.size());

            for (int i = 0; i < listaOperol.size(); i++) {
                Vector fila1 = new Vector();
                Operariorol or = (Operariorol) listaOperol.get(i);
                fila1.add(or.getRol().getNombreRol());
                fila1.add(or.getCargo().getNombreCargo());
                fila1.add(or.getArea().getNombreArea());
                
               

                tableModel.addRow(fila1);
            }
        } catch (Exception e) {
        }

    }

   private void cargarTablaOperariosbaja() {

        String[] encabezados = new String[4];
        encabezados[0] = "Apellido";
        encabezados[1] = "Nombre";
        encabezados[2] = "D.N.I";
        encabezados[3] = "Fecha Baja";

        tableModel = new TablaPersonalizada(encabezados);
        jTableOB.setModel(tableModel);

        try {
            listaobaja = controladorop.buscarOperarioBaja();
            System.out.println("tamaño de listaobaja" + listaobaja);

            for (int i = 0; i < listaobaja.size(); i++) {

                Operario operario = (Operario) listaobaja.get(i);
                Vector fila = new Vector();
                fila.add(operario.getApellido());
                fila.add(operario.getNombre());
                fila.add(operario.getNumerodocumento());
                fila.add(operario.getFechabaja());
                tableModel.addRow(fila);
            }

        } catch (Exception e) {
        }
    }

    private void eliminarRolDeOperario() {
        int ind =jTableACR.getSelectedRow();
        Operariorol opeRol= listaOperol.get(ind);
        opeRol.setFechafin(validador.getInstance().obtenerFechaSistema());
        try {
            controperariorol.modificarOperariorol(opeRol);
            JOptionPane.showMessageDialog(this, "Se ha eliminado ese rol del operario", "Eliminar Rol a Operario", JOptionPane.INFORMATION_MESSAGE);
cargarTablaAreaCargoRol();
        } catch (Exception ex) {
            Logger.getLogger(ABMOperario.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
